package com.bayair.doctor.ui.main.right;

import android.util.ArrayMap;

import com.bayair.doctor.data.bean.SetResp;
import com.bayair.doctor.mvp.IModel;
import com.bayair.doctor.net.BaseEntity;
import com.bayair.doctor.biz.helper.SpDoctor;

import io.reactivex.Observable;

public class RightModel extends IModel implements RightContract.Model {
    @Override
    public Observable<BaseEntity<SetResp>> setReceive(boolean isReceive) {
        ArrayMap<String, Object> map = new ArrayMap<>();
        map.put("token", SpDoctor.getToken());
        map.put("receive", isReceive ? 1 : 0);
        return mApi.setReceiveMsg(map);
    }

    @Override
    public Observable<BaseEntity<SetResp>> setInquiry(boolean isInquiry) {
        ArrayMap<String, Object> map = new ArrayMap<>();
        map.put("token", SpDoctor.getToken());
        map.put("inquiry", isInquiry ? 1 : 0);
        return mApi.setInquiry(map);
    }

    @Override
    public Observable<BaseEntity<SetResp>> logout() {
        ArrayMap<String, Object> map = new ArrayMap<>();
        map.put("token", SpDoctor.getToken());
        return mApi.logout(map);
    }


}
